<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8"/>
        <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
        <meta http-equiv="X-UA-Compatible" content="ie=edge"/>
        <title>Document</title>
        <script>
            /* 
                for循环(最多))
                    格式：
                        for(表达式1; 表达式2; 表达式3){
                            执行语句;
                        }
             */

             //1~100的和
           /*  var i = 1;
            var sum = 0;
            while(i <= 100){
                sum += i;
                i++;
            }
            alert(sum); */


           /*  var sum = 0;
            for(var i = 1; i <= 100; i++){
                sum += i;
            }

            alert(sum); */

            /* var sum = 0;
            var i = 1;
            for(; i <= 100; i++){
                sum += i;
            }

            alert(sum); */

            /* var sum = 0;
            var i = 1;
            for(; i <= 100; ){
                sum += i;
                i++;
            }

            alert(sum); */
        </script>
    </head>
    <body>
        
    </body>
</html>